<!DOCTYPE html>
<html xmlns:th="www.thymeleaf.org">
<meta charset="UTF-8">
<head th:replace="back/index::ph('登录')"></head>
<body>
	<header></header>
	<main>
		<div class="content">
			<fieldset>
				<legend><a href="/">首页</a> >> 登录</legend>
				<div class="form">
				账号：<input v-model="user.account"><label class="tip">{{tip.account}}</label><br>
				密码：<input v-model="user.pwd"><label class="tip">{{tip.pwd}}</label><br>
				<button @click="login">登录</button>
				</div>
			</fieldset>
		</div>
	</main>
	<footer th:replace="back/index::footer"></footer>
</body>
<script type="text/javascript">
	var v = new Vue({
		el : "fieldset",
		data : { user: {} , tip : {} },
		methods : {
			login(){
				axios.post("login",usp(this.user)).then(res=>{
					if(res.data.code==1){
						location.href="/";
					} else {
						alert(res.data.msg);
					}
				})
			}
		}
	})

</script>
</html>